home *** CD-ROM | disk | FTP | other *** search
/ MacTech 1 to 12 / MacTech-vol-1-12.toast / Source / MacTech® Magazine / Volume 03 - 1987 / 03.04 Apr 87 / MPW macros / doTaller < prev    next >
Encoding:
Text File  |  1987-01-27  |  873 b   |  29 lines  |  [TEXT/MPS ]

  1. #    This adjusts the height of a DITL item by the amount requested symmetrically
  2. #    The cursor must be somewhere on the line containing the boundary Rectangle
  3. #    Frank Alviani - Monday, January 26, 1987 2:17:29 PM
  4.  
  5. set exit 0
  6. set dir "`request -d T '<T>aller | <S>horten?'`"
  7. exit if ({dir} == "") OR ({status} != 0)
  8. set amt "`request -d 10 'Amount to adjust?'`"
  9. exit if ({amt} == "") OR ({status} != 0)
  10. find ¡0¡0 "{active}"    #ensure we're @ start of line
  11.  
  12. find /∂{/Δ:Δ/,/ "{active}"    #find top coord
  13. set t `catenate "{active}".§`
  14. if {dir} =~ /≈[Tt]≈/
  15.     set top `evaluate {t} - ({amt} ÷ 2)`    
  16. else
  17.     set top `evaluate {t} + ({amt} ÷ 2)`
  18. end
  19. replace § {top} "{active}"
  20.  
  21. find /,[0-9]+,/Δ:Δ/,/ "{active}"    #find right coord
  22. set t `catenate "{active}".§`
  23. if {dir} =~ /≈[Tt]≈/
  24.     set top `evaluate {t} + ({amt} ÷ 2)`
  25. else
  26.     set top `evaluate {t} - ({amt} ÷ 2)`
  27. end
  28. replace § {top} "{active}"
  29.